<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>编辑小说类别</title>
<link rel="stylesheet" type="text/css" href="/Fiction20250327/css/query.css" />
<script type="text/javascript" src="/Fiction20250327/js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="/Fiction20250327/js/category.js"></script>
<script type="text/javascript">
	$(function(){
		//获取当前编辑的类别ID
		var categoryId = new URLSearchParams(window.location.search).get("categoryid");
		if (categoryId != null&&categoryId!="null") {
			//在做修改操作
			var url="/Fiction20250327/queryById.category?";
			var params ={"categoryid":categoryId};
			$.get(url,params,function(data){
				var JsonObj =JSON.parse(data)
				$("#categoryId").val(JsonObj.categoryid);
				$("#categoryName").val(JsonObj.categoryname);
				$("#description").val(JsonObj.description);

			})


		}

	})
</script>
</head>
<body>
	<div id="top">·当前位置： 类别管理 -- 编辑小说类别</div>
	<form action="/Fiction20250327/addOrUpdate.category" method="post">
		<table id="tab" style="margin-top: 30px; border-collapse:separate; border-spacing:0px 10px;">
			<tr>
				<td align="right">类别ID : </td>
				<td align="left">&nbsp;<input type="text" id="categoryId" placeholder="新增无需填写" readonly="readonly" name="categoryid"/></td>
			</tr>
			<tr>
				<td align="right" style="width:40%;">类别名称 : </td>
				<td align="left">&nbsp;<input type="text" id="categoryName" name="categoryname" /><span
					style="color: red"> *</span><span id="message0" style="color: red;" class="message"></span></td>
			</tr>
			<tr>
				<td align="right">类别描述 : </td>
				<td align="left">&nbsp;<textarea id="description" name="description"></textarea><span
					style="color: red"> *</span><span id="message1" style="color: red;" class="message"></span></td>
			</tr>
			<tr>
				<td colspan="2"><input style="width: 60px;" type="submit" id="submit"
					value="提交" /></td>
			</tr>
		</table>
	</form>
</body>
</html>